home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / answers / comp / audio-fmts / part2 < prev    next >
Text File  |  1994-03-11  |  48KB  |  1,208 lines

  1. Newsgroups: alt.binaries.sounds.misc,alt.binaries.sounds.d,comp.dsp,alt.answers,comp.answers,news.answers
  2. Path: bloom-beacon.mit.edu!hookup!europa.eng.gtefsd.com!howland.reston.ans.net!EU.net!sun4nl!cwi.nl!guido
  3. From: guido@cwi.nl (Guido van Rossum)
  4. Subject: FAQ: Audio File Formats (part 2 of 2)
  5. Message-ID: <audio-part2_761913666@charon.cwi.nl>
  6. Followup-To: alt.binaries.sounds.d,comp.dsp
  7. Sender: news@cwi.nl (The Daily Dross)
  8. Supersedes: <audio-part2_759445072@charon.cwi.nl>
  9. Nntp-Posting-Host: voorn.cwi.nl
  10. Reply-To: guido@cwi.nl
  11. Organization: CWI, Amsterdam
  12. Date: Tue, 22 Feb 1994 10:41:15 GMT
  13. Approved: news-answers-request@MIT.Edu
  14. Expires: Tue, 22 Mar 1994 10:41:06 GMT
  15. Lines: 1190
  16. Xref: bloom-beacon.mit.edu alt.binaries.sounds.misc:13672 alt.binaries.sounds.d:3313 comp.dsp:5170 alt.answers:1928 comp.answers:3870 news.answers:15529
  17.  
  18. Archive-name: audio-fmts/part2
  19. Submitted-by: Guido van Rossum <guido@cwi.nl>
  20. Version: 3.05
  21. Last-modified: 27-Sep-1993
  22.  
  23. Appendices
  24. ==========
  25.  
  26. Here are some more detailed pieces of info that I received by e-mail.
  27. They are reproduced here virtually without much editing.
  28.  
  29. Table of contents
  30. -----------------
  31.  
  32. FTP access for non-internet sites
  33. AIFF Format (Audio IFF)
  34. The NeXT/Sun audio file format
  35. IFF/8SVX Format
  36. Playing sound on a PC
  37. The EA-IFF-85 documentation
  38. US Federal Standard 1016 availability
  39. Creative Voice (VOC) file format
  40. RIFF WAVE (.WAV) file format
  41. U-LAW and A-LAW definitions
  42. AVR File Format
  43. The Amiga MOD Format
  44.  
  45. ------------------------------------------------------------------------
  46. FTP access for non-internet sites
  47. ---------------------------------
  48.  
  49. From the sci.space FAQ:
  50.  
  51.     Sites not connected to the Internet cannot use FTP directly, but
  52.     there are a few automated FTP servers which operate via email.
  53.     Send mail containing only the word HELP to ftpmail@decwrl.dec.com
  54.     or bitftp@pucc.princeton.edu, and the servers will send you
  55.     instructions on how to make requests.  (The bitftp service is no
  56.     longer available through UUCP gateways due to complaints about
  57.     overuse :-( )
  58.  
  59. Also:
  60.  
  61.     FAQ lists are available by anonymous FTP from rftm.mit.edu
  62.     and by email from mail-server@rtfm.mit.edu (send a message
  63.     containing "help" for instructions about the mail server).
  64.  
  65.  
  66. ------------------------------------------------------------------------
  67. AIFF Format (Audio IFF) and AIFC
  68. --------------------------------
  69.  
  70. This format was developed by Apple for storing high-quality sampled
  71. sound and musical instrument info; it is also used by SGI and several
  72. professional audio packages (sorry, I know no names).  An extension,
  73. called AIFC or AIFF-C, supports compression (see the last item below).
  74.  
  75. I've made a BinHex'ed MacWrite version of the AIFF spec (no idea if
  76. it's the same text as mentioned below) available by anonymous ftp from
  77. ftp.cwi.nl [192.16.184.180]; the file is /pub/audio/AudioIFF1.2.hqx.
  78. A newer version is also available: /pub/audio/AudioIFF1.3.hqx.
  79. But you may be better off with the AIFF-C specs, see below.
  80.  
  81. Mike Brindley (brindley@ece.orst.edu) writes:
  82.  
  83. "The complete AIFF spec by Steve Milne, Matt Deatherage (Apple) is
  84. available in 'AMIGA ROM Kernal Reference Manual: Devices (3rd Edition)'
  85. 1991 by Commodore-Amiga, Inc.; Addison-Wesley Publishing Co.; 
  86. ISBN 0-201-56775-X, starting on page 435 (this edition has a charcoal
  87. grey cover).  It is available in most bookstores, and soon in many
  88. good librairies."
  89.  
  90. According to Mark Callow (msc@sgi.com):
  91.  
  92. A PostScript version of the AIFF-C specification is available via
  93. anonymous ftp on FTP.SGI.COM (192.48.153.1) as /sgi/aiff-c.9.26.91.ps.
  94.  
  95. Benjamin Denckla <bdenckla@husc.harvard.edu> writes:
  96.  
  97. A piece of information that may be of some use to people who want to use
  98. AIFF files with their Macintosh Think C programs:  AIFF data structures are
  99. contained in the file AIFF.h in the "Apple #Includes" folder that comes
  100. on the distribution disks.  I found this out a little too late: I had
  101. already coded my own structures.  I assume that this header file comes
  102. with Apple programming products like MPW [C|C++] as well.
  103.  
  104. An important file format for the Mac which is only mentioned once in the
  105. FAQ is the Sound Designer II file format.  There is also an older Sound
  106. Designer I format.  I have the SDII format in electronic form but I don't
  107. think I'm at liberty to distribute it.  It can be obtained by applying to
  108. become a 3rd Party Developer for Digidesign.  This process is simple
  109. (1-page application) and free.  Call Digidesign at 415-688-0600 for
  110. information.  The SDII file format is interesting in that all non-sample
  111. data (sample rate, channels, etc.) is contained in the resource fork and
  112. the data fork contains sample data only.
  113.  
  114. ------------------------------------------------------------------------
  115. The NeXT/Sun audio file format
  116. ------------------------------
  117.  
  118. Here's the complete story on the file format, from the NeXT
  119. documentation.  (Note that the "magic" number is ((int)0x2e736e64),
  120. which equals ".snd".)  Also, at the end, I've added a litte document
  121. that someone posted to the net a couple of years ago, that describes
  122. the format in a bit-by-bit fashion rather than from C.
  123.  
  124. I received this from Doug Keislar, NeXT Computer.  This is also the
  125. Sun format, except that Sun doesn't recognize as many format codes.  I
  126. added the numeric codes to the table of formats and sorted it.
  127.  
  128.  
  129. SNDSoundStruct:  How a NeXT Computer Represents Sound
  130.  
  131. The NeXT sound software defines the SNDSoundStruct structure to  
  132. represent sound.  This structure defines the soundfile and Mach-O  
  133. sound segment formats and the sound pasteboard type.  It's also used  
  134. to describe sounds in Interface Builder.  In addition, each instance  
  135. of the Sound Kit's Sound class encapsulates a SNDSoundStruct and  
  136. provides methods to access and modify its attributes.
  137.  
  138. Basic sound operations, such as playing, recording, and cut-and-paste  
  139. editing, are most easily performed by a Sound object.  In many cases,  
  140. the Sound Kit obviates the need for in-depth understanding of the  
  141. SNDSoundStruct architecture.  For example, if you simply want to  
  142. incorporate sound effects into an application, or to provide a simple  
  143. graphic sound editor (such as the one in the Mail application), you  
  144. needn't be aware of the details of the SNDSoundStruct.  However, if  
  145. you want to closely examine or manipulate sound data you should be  
  146. familiar with this structure.
  147.  
  148. The SNDSoundStruct contains a header, information that describes the  
  149. attributes of a sound, followed by the data (usually samples) that  
  150. represents the sound.  The structure is defined (in  
  151. sound/soundstruct.h) as:
  152.  
  153. typedef struct {
  154.     int magic;               /* magic number SND_MAGIC */
  155.     int dataLocation;        /* offset or pointer to the data */
  156.     int dataSize;            /* number of bytes of data */
  157.     int dataFormat;          /* the data format code */
  158.     int samplingRate;        /* the sampling rate */
  159.     int channelCount;        /* the number of channels */
  160.     char info[4];            /* optional text information */
  161. } SNDSoundStruct;
  162.  
  163.  
  164.  
  165.  
  166. SNDSoundStruct Fields
  167.  
  168.  
  169.  
  170. magic
  171.  
  172. magic is a magic number that's used to identify the structure as a  
  173. SNDSoundStruct.  Keep in mind that the structure also defines the  
  174. soundfile and Mach-O sound segment formats, so the magic number is  
  175. also used to identify these entities as containing a sound.
  176.  
  177.  
  178.  
  179.  
  180.  
  181. dataLocation
  182.  
  183. It was mentioned above that the SNDSoundStruct contains a header  
  184. followed by sound data.  In reality, the structure only contains the  
  185. header; the data itself is external to, although usually contiguous  
  186. with, the structure.  (Nonetheless, it's often useful to speak of the  
  187. SNDSoundStruct as the header and the data.)  dataLocation is used to  
  188. point to the data.  Usually, this value is an offset (in bytes) from  
  189. the beginning of the SNDSoundStruct to the first byte of sound data.   
  190. The data, in this case, immediately follows the structure, so  
  191. dataLocation can also be thought of as the size of the structure's  
  192. header.  The other use of dataLocation, as an address that locates  
  193. data that isn't contiguous with the structure, is described in  
  194. "Format Codes," below.
  195.  
  196.  
  197.  
  198.  
  199.  
  200. dataSize, dataFormat, samplingRate, and channelCount
  201.  
  202. These fields describe the sound data.
  203.  
  204. dataSize is its size in bytes (not including the size of the  
  205. SNDSoundStruct).
  206.  
  207. dataFormat is a code that identifies the type of sound.  For sampled  
  208. sounds, this is the quantization format.  However, the data can also  
  209. be instructions for synthesizing a sound on the DSP.  The codes are  
  210. listed and explained in "Format Codes," below.
  211.  
  212. samplingRate is the sampling rate (if the data is samples).  Three  
  213. sampling rates, represented as integer constants, are supported by  
  214. the hardware:
  215.  
  216. Constant        Sampling Rate (samples/sec) 
  217.  
  218. SND_RATE_CODEC  8012.821        (CODEC input)
  219. SND_RATE_LOW    22050.0 (low sampling rate output)
  220. SND_RATE_HIGH   44100.0 (high sampling rate output)
  221.  
  222. channelCount is the number of channels of sampled sound.
  223.  
  224.  
  225.  
  226.  
  227.  
  228. info
  229.  
  230. info is a NULL-terminated string that you can supply to provide a  
  231. textual description of the sound.  The size of the info field is set  
  232. when the structure is created and thereafter can't be enlarged.  It's  
  233. at least four bytes long (even if it's unused).
  234.  
  235.  
  236.  
  237.  
  238.  
  239. Format Codes
  240.  
  241. A sound's format is represented as a positive 32-bit integer.  NeXT  
  242. reserves the integers 0 through 255; you can define your own format  
  243. and represent it with an integer greater than 255.  Most of the  
  244. formats defined by NeXT describe the amplitude quantization of  
  245. sampled sound data:
  246.  
  247. Value   Code    Format 
  248.  
  249. 0       SND_FORMAT_UNSPECIFIED  unspecified format 
  250. 1       SND_FORMAT_MULAW_8      8-bit mu-law samples
  251. 2       SND_FORMAT_LINEAR_8     8-bit linear samples
  252. 3       SND_FORMAT_LINEAR_16    16-bit linear samples
  253. 4       SND_FORMAT_LINEAR_24    24-bit linear samples
  254. 5       SND_FORMAT_LINEAR_32    32-bit linear samples
  255. 6       SND_FORMAT_FLOAT        floating-point samples
  256. 7       SND_FORMAT_DOUBLE       double-precision float samples
  257. 8       SND_FORMAT_INDIRECT     fragmented sampled data
  258. 9       SND_FORMAT_NESTED       ?
  259. 10      SND_FORMAT_DSP_CORE     DSP program
  260. 11      SND_FORMAT_DSP_DATA_8   8-bit fixed-point samples
  261. 12      SND_FORMAT_DSP_DATA_16  16-bit fixed-point samples
  262. 13      SND_FORMAT_DSP_DATA_24  24-bit fixed-point samples
  263. 14      SND_FORMAT_DSP_DATA_32  32-bit fixed-point samples
  264. 15      ?
  265. 16      SND_FORMAT_DISPLAY      non-audio display data
  266. 17      SND_FORMAT_MULAW_SQUELCH        ?
  267. 18      SND_FORMAT_EMPHASIZED   16-bit linear with emphasis
  268. 19      SND_FORMAT_COMPRESSED   16-bit linear with compression
  269. 20      SND_FORMAT_COMPRESSED_EMPHASIZED        A combination of the two above
  270. 21      SND_FORMAT_DSP_COMMANDS Music Kit DSP commands
  271. 22      SND_FORMAT_DSP_COMMANDS_SAMPLES         ?
  272. [Some new ones supported by Sun.  This is all I currently know. --GvR]
  273. 23      SND_FORMAT_ADPCM_G721
  274. 24      SND_FORMAT_ADPCM_G722
  275. 25      SND_FORMAT_ADPCM_G723_3
  276. 26      SND_FORMAT_ADPCM_G723_5
  277. 27      SND_FORMAT_ALAW_8
  278.  
  279.  
  280. Most formats identify different sizes and types of  
  281. sampled data.  Some deserve special note:  
  282.  
  283.  
  284. --      SND_FORMAT_DSP_CORE format contains data that represents a  
  285. loadable DSP core program.  Sounds in this format are required by the  
  286. SNDBootDSP() and SNDRunDSP() functions.  You create a  
  287. SND_FORMAT_DSP_CORE sound by reading a DSP load file (extension  
  288. ".lod") with the SNDReadDSPfile() function.
  289.  
  290. --      SND_FORMAT_DSP_COMMANDS is used to distinguish sounds that  
  291. contain DSP commands created by the Music Kit.  Sounds in this format  
  292. can only be created through the Music Kit's Orchestra class, but can  
  293. be played back through the SNDStartPlaying() function.
  294.  
  295. --      SND_FORMAT_DISPLAY format is used by the Sound Kit's  
  296. SoundView class.  Such sounds can't be played.  
  297.  
  298.  
  299. --      SND_FORMAT_INDIRECT indicates data that has become  
  300. fragmented, as described in a separate section, below.  
  301.  
  302.  
  303. --      SND_FORMAT_UNSPECIFIED is used for unrecognized formats.
  304.  
  305.  
  306.  
  307.  
  308.  
  309. Fragmented Sound Data
  310.  
  311. Sound data is usually stored in a contiguous block of memory.   
  312. However, when sampled sound data is edited (such that a portion of  
  313. the sound is deleted or a portion inserted), the data may become  
  314. discontiguous, or fragmented.  Each fragment of data is given its own  
  315. SNDSoundStruct header; thus, each fragment becomes a separate  
  316. SNDSoundStruct structure.  The addresses of these new structures are  
  317. collected into a contiguous, NULL-terminated block; the dataLocation  
  318. field of the original SNDSoundStruct is set to the address of this  
  319. block, while the original format, sampling rate, and channel count  
  320. are copied into the new SNDSoundStructs.  
  321.  
  322.  
  323. Fragmentation serves one purpose:  It avoids the high cost of moving  
  324. data when the sound is edited.  Playback of a fragmented sound is  
  325. transparent-you never need to know whether the sound is fragmented  
  326. before playing it.  However, playback of a heavily fragmented sound  
  327. is less efficient than that of a contiguous sound.  The  
  328. SNDCompactSamples() C function can be used to compact fragmented  
  329. sound data.
  330.  
  331. Sampled sound data is naturally unfragmented.  A sound that's freshly  
  332. recorded or retrieved from a soundfile, the Mach-O segment, or the  
  333. pasteboard won't be fragmented.  Keep in mind that only sampled data  
  334. can become fragmented.
  335.  
  336.  
  337.  
  338. _________________________
  339. >From mentor.cc.purdue.edu!purdue!decwrl!ucbvax!ziploc!eps Wed Apr  4  
  340. 23:56:23 EST 1990
  341. Article 5779 of comp.sys.next:
  342. Path: mentor.cc.purdue.edu!purdue!decwrl!ucbvax!ziploc!eps
  343. >From: eps@toaster.SFSU.EDU (Eric P. Scott)
  344. Newsgroups: comp.sys.next
  345. Subject: Re: Format of NeXT sndfile headers?
  346. Message-ID: <445@toaster.SFSU.EDU>
  347. Date: 31 Mar 90 21:36:17 GMT
  348. References: <14978@phoenix.Princeton.EDU>
  349. Reply-To: eps@cs.SFSU.EDU (Eric P. Scott)
  350. Organization: San Francisco State University
  351. Lines: 42
  352.  
  353. In article <14978@phoenix.Princeton.EDU>
  354.         bskendig@phoenix.Princeton.EDU (Brian Kendig) writes:
  355. >I'd like to take a program I have that converts Macintosh sound  
  356. files
  357. >to NeXT sndfiles and polish it up a bit to go the other direction as
  358. >well.
  359.  
  360. Two people have already submitted programs that do this
  361. (Christopher Lane and Robert Hood); check the various
  362. NeXT archive sites.
  363.  
  364. >       Could someone please give me the format of a NeXT sndfile
  365. >header?
  366.  
  367. "big-endian"
  368.         0       1       2       3
  369.         +-------+-------+-------+-------+
  370. 0       | 0x2e  | 0x73  | 0x6e  | 0x64  |       "magic" number
  371.         +-------+-------+-------+-------+
  372. 4       |                               |       data location
  373.         +-------+-------+-------+-------+
  374. 8       |                               |       data size
  375.         +-------+-------+-------+-------+
  376. 12      |                               |       data format (enum)
  377.         +-------+-------+-------+-------+
  378. 16      |                               |       sampling rate (int)
  379.         +-------+-------+-------+-------+
  380. 20      |                               |       channel count
  381.         +-------+-------+-------+-------+
  382. 24      |       |       |       |       |       (optional) info  
  383. string
  384.  
  385. 28 = minimum value for data location
  386.  
  387. data format values can be found in /usr/include/sound/soundstruct.h
  388.  
  389. Most common combinations:
  390.  
  391.          sampling  channel    data
  392.              rate    count  format              
  393. voice file   8012        1       1 =  8-bit mu-law
  394. system beep 22050        2       3 = 16-bit linear
  395. CD-quality  44100        2       3 = 16-bit linear
  396.  
  397. ------------------------------------------------------------------------
  398. IFF/8SVX Format
  399. ---------------
  400.  
  401. Newsgroups: alt.binaries.sounds.d,alt.sex.sounds
  402. Subject: Format of the IFF header (Amiga sounds)
  403. Message-ID: <2509@tardis.Tymnet.COM>
  404. From: jms@tardis.Tymnet.COM (Joe Smith)
  405. Date: 23 Oct 91 23:54:38 GMT
  406. Followup-To: alt.binaries.sounds.d
  407. Organization: BT North America (Tymnet)
  408.  
  409. The first 12 bytes of an IFF file are used to distinguish between an Amiga
  410. picture (FORM-ILBM), an Amiga sound sample (FORM-8SVX), or other file
  411. conforming to the IFF specification.  The middle 4 bytes is the count of
  412. bytes that follow the "FORM" and byte count longwords.  (Numbers are stored
  413. in M68000 form, high order byte first.)
  414.  
  415.                 ------------------------------------------
  416.  
  417. FutureSound audio file, 15000 samples at 10.000KHz, file is 15048 bytes long.
  418.  
  419. 0000: 464F524D 00003AC0 38535658 56484452    FORM..:.8SVXVHDR
  420.       F O R M     15040 8 S V X  V H D R
  421. 0010: 00000014 00003A98 00000000 00000000    ......:.........
  422.             20    15000        0        0
  423. 0020: 27100100 00010000 424F4459 00003A98    '.......BODY..:.
  424.      10000 1 0    1.0   B O D Y     15000
  425.  
  426. 0000000..03 = "FORM", identifies this as an IFF format file.
  427. FORM+00..03 (ULONG) = number of bytes that follow.  (Unsigned long int.)
  428. FORM+03..07 = "8SVX", identifies this as an 8-bit sampled voice.
  429.  
  430. ????+00..03 = "VHDR", Voice8Header, describes the parameters for the BODY.
  431. VHDR+00..03 (ULONG) = number of bytes to follow. 
  432. VHDR+04..07 (ULONG) = samples in the high octave 1-shot part.
  433. VHDR+08..0B (ULONG) = samples in the high octave repeat part.
  434. VHDR+0C..0F (ULONG) = samples per cycle in high octave (if repeating), else 0.
  435. VHDR+10..11 (UWORD) = samples per second.  (Unsigned 16-bit quantity.)
  436. VHDR+12     (UBYTE) = number of octaves of waveforms in sample.
  437. VHDR+13     (UBYTE) = data compression (0=none, 1=Fibonacci-delta encoding).
  438. VHDR+14..17 (FIXED) = volume.  (The number 65536 means 1.0 or full volume.)
  439.  
  440. ????+00..03 = "BODY", identifies the start of the audio data.
  441. BODY+00..03 (ULONG) = number of bytes to follow.
  442. BODY+04..NNNNN      = Data, signed bytes, from -128 to +127.
  443.  
  444. 0030: 04030201 02030303 04050605 05060605
  445. 0040: 06080806 07060505 04020202 01FF0000
  446. 0050: 00000000 FF00FFFF FFFEFDFD FDFEFFFF
  447. 0060: FDFDFF00 00FFFFFF 00000000 00FFFF00
  448. 0070: 00000000 00FF0000 00FFFEFF 00000000
  449. 0080: 00010000 000101FF FF0000FE FEFFFFFE
  450. 0090: FDFDFEFD FDFFFFFC FDFEFDFD FEFFFEFE
  451. 00A0: FFFEFEFE FEFEFEFF FFFFFEFF 00FFFF01
  452.  
  453. This small section of the audio sample shows the number ranging from -5 (0xFD)
  454. to +8 (0x08).  Warning: Do not assume that the BODY starts 48 bytes into the
  455. file.  In addition to "VHDR", chunks labeled "NAME", "AUTH", "ANNO", or 
  456. "(c) " may be present, and may be in any order.  You will have to check the
  457. byte count in each chunk to determine how many bytes to skip.
  458.  
  459. ------------------------------------------------------------------------
  460. Playing sound on a PC
  461. ---------------------
  462.  
  463. From: Eric A Rasmussen
  464.  
  465. Any turbo PC (8088 at 8 Mhz or greater)/286/386/486/etc. can produce a quality
  466. playback of single channel 8 bit sounds on the internal (1 bit, 1 channel)
  467. speaker by utilizing Pulse-Width-Modulation, which toggles the speaker faster
  468. than it can physically move to simulate positions between fully on and fully
  469. off.  There are several PD programs of this nature that I know of:
  470.  
  471. REMAC  - Plays MAC format sound files.  Files on the Macintosh, at least the
  472.          sound files that I've ripped apart, seem to contain 3 parts.  The
  473.          first two are info like what the file icon looks like and other
  474.          header type info.  The third part contains the raw sample data, and
  475.          it is this portion of the file which is saved to a seperate file,
  476.          often named with the .snd extension by PC users.  Personally, I like
  477.          to name the files .s1, .s2, .s3, or .s4 to indicate the sampling rate
  478.          of the file. (-s# is how to specify the playback rate in REMAC.)
  479.          REMAC provides playback rates of 5550hz, 7333hz, 11 khz, & 22 khz.
  480. REMAC2 - Same as REMAC, but sounds better on higher speed machines.
  481. REPLAY - Basically same as REMAC, but for playback of Atari ST sounds. 
  482.          Apparently, the Atari has two sound formats, one of which sounds like
  483.          garbage if played by REMAC or REPLAY in the incorrect mode.  The
  484.          other file format works fine with REMAC and so appears to be 'normal'
  485.          unsigned 8-bit data.  REPLAY provides playback rates of 11.5 khz,
  486.          12.5 khz, 14 khz, 16 khz, 18.5 khz, 22khz, & 27 khz.
  487.  
  488. These three programs are all by the same author, Richard E. Zobell who does
  489. not have an internet mail address to my knowledge, but does have a GEnie email
  490. address of R.ZOBELL. 
  491.  
  492. Additionally, there are various stand-alone demos which use the internal
  493. speaker, of which there is one called mushroom which plays a 30 second
  494. advertising jingle for magic mushroom room deoderizers which is pretty
  495. humerous.  I've used this player to playback samples that I ripped out of the
  496. commercial game program Mean Streets, which uses something they call RealSound
  497. (tm) to playback digital samples on the internal speaker. (Of course, I only do
  498. this on my own system, and since I own the game, I see no problems with it.)
  499.  
  500. For owners of 8 Mhz 286's and above, the option to play 4 channel 8 bit sounds
  501. (with decent quality) on the internal speaker is also a reality.  Quite a
  502. number of PD programs exist to do this, including, but not limited to:
  503.  
  504. ModEdit, ModPlay, ScreamTracker, STM, Star Trekker, Tetra, and probably a few
  505. more.  
  506.  
  507. All these programs basically make use of various sound formats used by the
  508. Amiga line of computers.  These include .stm files, .mod files
  509. [a.k.a. mod. files], and .nst files [really the same hing].  Also,
  510. these programs pretty much all have the option to playback the 
  511. sound to add-on hardware such as the SoundBlaster card, the Covox series of
  512. devices, and also to direct the data to either one or two (for stereo)
  513. parallel ports, which you could attach your own D/A's to.  (From what I have
  514. seen, the Covox is basically an small amplified speaker with a D/A which plugs
  515. into the parallel port.  This sounds very similiar to the Disney Sound System
  516. (DSS) which people have been talking about recently.)  
  517.  
  518. ------------------------------------------------------------------------
  519. The EA-IFF-85 documentation
  520. ---------------------------
  521.  
  522. From: dgc3@midway.uchicago.edu
  523.  
  524. As promised, here's an ftp location for the EA-IFF-85 documentation.  It's
  525. the November 1988 release as revised by Commodore (the last public release),
  526. with specifications for IFF FORMs for graphics, sound, formatted text, and
  527. more.  IFF FORMS now exist for other media, including structured drawing, and
  528. new documentation is now available only from Commodore.
  529.  
  530. The documentation is at grind.isca.uiowa.edu [128.255.19.233], in the
  531. directory /amiga/f1/ff185.  The complete file list is as follows:
  532.  
  533. DOCUMENTS.zoo    
  534. EXAMPLES.zoo     
  535. EXECUTABLE.zoo   
  536. INCLUDE.zoo      
  537. LINKER_INFO.zoo  
  538. OBJECT.zoo       
  539. SOURCE.zoo       
  540. TP_IFF_Specs.zoo 
  541.  
  542. All files except DOCUMENTS.zoo are Amiga-specific, but may be used as a basis
  543. for conversion to other platforms.  Well, I take that tentatively back.  I
  544. don't know what TP_IFF_Specs.zoo contains, so it might be non-Amiga-specific.
  545.  
  546. ------------------------------------------------------------------------
  547. US Federal Standard 1016 availability
  548. -------------------------------------
  549.  
  550. From: jpcampb@afterlife.ncsc.mil (Joe Campbell)
  551.  
  552. The U.S. DoD's Federal-Standard-1016 based 4800 bps code excited linear
  553. prediction voice coder version 3.2 (CELP 3.2) Fortran and C simulation
  554. source codes are available for worldwide distribution (on DOS
  555. diskettes, but configured to compile on Sun SPARC stations) from NTIS
  556. and DTIC.  Example input and processed speech files are included.  A
  557. Technical Information Bulletin (TIB), "Details to Assist in
  558. Implementation of Federal Standard 1016 CELP," and the official
  559. standard, "Federal Standard 1016, Telecommunications:  Analog to
  560. Digital Conversion of Radio Voice by 4,800 bit/second Code Excited
  561. Linear Prediction (CELP)," are also available.
  562.  
  563. This is available through the National Technical Information Service:
  564.  
  565. NTIS
  566. U.S. Department of Commerce
  567. 5285 Port Royal Road
  568. Springfield, VA  22161
  569. USA
  570. (703) 487-4650
  571.  
  572. The "AD" ordering number for the CELP software is AD M000 118
  573. (US$ 90.00) and for the TIB it's AD A256 629 (US$ 17.50).  The LPC-10
  574. standard, described below, is FIPS Pub 137 (US$ 12.50).  There is a
  575. $3.00 shipping charge on all U.S. orders.  The telephone number for
  576. their automated system is 703-487-4650, or 703-487-4600 if you'd prefer
  577. to talk with a real person.
  578.  
  579. (U.S. DoD personnel and contractors can receive the package from the
  580. Defense Technical Information Center:  DTIC, Building 5, Cameron
  581. Station, Alexandria, VA 22304-6145.  Their telephone number is
  582. 703-274-7633.)
  583.  
  584. The following articles describe the Federal-Standard-1016 4.8-kbps CELP
  585. coder (it's unnecessary to read more than one):
  586.  
  587. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch,
  588. "The Federal Standard 1016 4800 bps CELP Voice Coder," Digital Signal
  589. Processing, Academic Press, 1991, Vol. 1, No. 3, p. 145-155.
  590.  
  591. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch,
  592. "The DoD 4.8 kbps Standard (Proposed Federal Standard 1016),"
  593. in Advances in Speech Coding, ed. Atal, Cuperman and Gersho,
  594. Kluwer Academic Publishers, 1991, Chapter 12, p. 121-133.
  595.  
  596. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch, "The
  597. Proposed Federal Standard 1016 4800 bps Voice Coder:  CELP," Speech
  598. Technology Magazine, April/May 1990, p. 58-64.
  599.  
  600.  
  601. The U.S. DoD's Federal-Standard-1015/NATO-STANAG-4198 based 2400 bps
  602. linear prediction coder (LPC-10) was republished as a Federal
  603. Information Processing Standards Publication 137 (FIPS Pub 137).
  604. It is described in:
  605.  
  606. Thomas E. Tremain, "The Government Standard Linear Predictive Coding
  607. Algorithm:  LPC-10," Speech Technology Magazine, April 1982, p. 40-49.
  608.  
  609. There is also a section about FS-1015 in the book:
  610. Panos E. Papamichalis, Practical Approaches to Speech Coding,
  611. Prentice-Hall, 1987.
  612.  
  613. The voicing classifier used in the enhanced LPC-10 (LPC-10e) is described in:
  614. Campbell, Joseph P., Jr. and T. E. Tremain, "Voiced/Unvoiced Classification
  615. of Speech with Applications to the U.S. Government LPC-10E Algorithm,"
  616. Proceedings of the IEEE International Conference on Acoustics, Speech, and
  617. Signal Processing, 1986, p. 473-6.
  618.  
  619. Copies of the official standard
  620. "Federal Standard 1016, Telecommunications: Analog to Digital Conversion
  621. of Radio Voice by 4,800 bit/second Code Excited Linear Prediction (CELP)"
  622. are available for US$ 5.00 each from:
  623.  
  624. GSA Federal Supply Service Bureau
  625. Specification Section, Suite 8100
  626. 470 E. L'Enfant Place, S.W.
  627. Washington, DC  20407
  628. (202)755-0325
  629.  
  630. Realtime DSP code for FS-1015 and FS-1016 is sold by:
  631.  
  632. John DellaMorte
  633. DSP Software Engineering
  634. 165 Middlesex Tpk, Suite 206
  635. Bedford, MA  01730
  636. USA
  637. 1-617-275-3733
  638. 1-617-275-4323 (fax)
  639. dspse.bedford@channel1.com
  640.  
  641. DSP Software Engineering's FS-1016 code can run on a DSP Research's Tiger 30
  642. (a PC board with a TMS320C3x and analog interface suited to development work).
  643.  
  644. DSP Research                
  645. 1095 E. Duane Ave.          
  646. Sunnyvale, CA  94086        
  647. USA
  648. (408)773-1042               
  649. (408)736-3451 (fax)         
  650.  
  651. From: cfreese@super.org (Craig F. Reese)
  652. Newsgroups: comp.speech,comp.dsp,comp.compression.research
  653. Subject: CELP 3.2a release now available
  654. Organization: Supercomputing Research Center (Bowie, MD)
  655. Date: Tue, 3 Aug 1993 14:55:25 GMT
  656.  
  657. 3 August 1993
  658.  
  659. CELP 3.2a Release
  660.  
  661. Dear CELPers,
  662.  
  663. We have placed an updated version of the FS-1016 CELP 3.2 code in the
  664. anonymous FTP area on super.org (192.31.192.1).  It's in:
  665.  
  666.   /pub/celp_3.2a.tar.Z (please be sure to do the ftp in binary mode).
  667.  
  668. This is essentially the PC release that was on fumar, except that we
  669. started directly from the PC disks.  The value added is that we have
  670. made over 69 corrections and fixes.  Most of these were necessary
  671. because of the 8 character file name limit on DOS, but there are some
  672. others, as well.
  673.  
  674. The code (C, FORTRAN, diskio) all has been built and tested on a Sun4
  675. under SunOS4.1.3.  If you want to run it somewhere else, then you may
  676. have to do a bit of work.  (A Solaris 2.x-compatible release is
  677. planned soon.)
  678.  
  679. [One note to PCers.  The files:
  680. [
  681. [       cbsearch.F celp.F csub.F mexcite.F psearch.F
  682. [
  683. [are meant to be passed through the C preprocessor (cpp).
  684. [We gather that DOS (or whatever it's called) can't distinguish 
  685. [the .F from a .f.  Be careful!
  686.  
  687. Very limited support is available from the authors (Joe, et al.).
  688. Please do not send questions or suggestions without first reading the
  689. documentation (README files, the Technical Information Bulletin, etc.).
  690. The authors would enjoy hearing from you, but they have limited time
  691. for support and would like to use it as efficiently as possible.  They
  692. welcome bug reports, but, again, please read the documentation first.
  693. All users of FS-1016 CELP software are strongly encouraged to acquire
  694. the latest release (version 3.2a as of this writing).
  695.  
  696. We do not know how long we will be able to leave the software on this
  697. site, but it should be _at_least_ through 1 October 1993 (if you find
  698. it missing, please drop me (Craig) a note).  Please try to get the
  699. software during off hours (8 p.m. - 7 a.m. Eastern Standard time) or
  700. folks here might complain and we'll have to get rid of the code (if
  701. that happens, we'll try to pass it on to someone else, who can put it
  702. on the net).  We would be more than happy for someone to copy it and
  703. make it available elsewhere.
  704.  
  705. Good Luck,
  706.  
  707. Craig F. Reese  (cfreese@super.org)
  708. IDA/Supercomputing Research Center
  709.  
  710. Joe Campbell (jpcampb@afterlife.ncsc.mil)
  711. Department of Defense
  712.  
  713. P.S.  Just so you all know, I (Craig) am not actually involved in
  714. CELP work.  I mainly got with Joe to help make the software available
  715. on the Internet.  In the course of doing so, I cleaned up much of it,
  716. but I am not, by any stretch, a CELP expert and will most likely
  717. be unable to answer any technical questions concerning it. ;^)
  718.  
  719. From: tobiasr@monolith.lrmsc.loral.com (Richard Tobias)
  720.  
  721. For U.S. FED-STD-1016 (4800 bps CELP) _realtime_ DSP code and
  722. information about products using this code using the AT&T DSP32C and
  723. AT&T DSP3210, contact:
  724.  
  725. White Eagle Systems Technology, Inc.
  726. 1123 Queensbridge Way
  727. San Jose, CA 95120
  728. (408) 997-2706
  729. (408) 997-3584 (fax)
  730. rjjt@netcom.com
  731.  
  732. From: Cole Erskine <cole@analogical.com>
  733.  
  734. [paraphrased]
  735.  
  736. Analogical Systems has a _real-time_ multirate implementation of U.S.
  737. Federal Standard 1016 CELP operating at bit rates of 4800, 7200, and
  738. 9600 bps on a single 27MHz Motorola DSP56001. Source and object code
  739. is available for a one-time license fee.
  740.  
  741. FREE, _real-time_ demonstration software for the Ariel PC-56D is
  742. available for those who already have such a board by contacting
  743. Analogical Systems.  The demo software allows you to record and
  744. playback CELP files to and from the PC's hard disk.
  745.  
  746. Analogical Systems
  747. 2916 Ramona Street
  748. Palo Alto, CA 94306
  749. Tel: +1 (415) 323-3232
  750. FAX: +1 (415) 323-4222
  751.  
  752. ------------------------------------------------------------------------
  753. Creative Voice (VOC) file format
  754. --------------------------------
  755.  
  756. From: galt@dsd.es.com
  757.  
  758. (byte numbers are hex!)
  759.  
  760.     HEADER (bytes 00-19)
  761.     Series of DATA BLOCKS (bytes 1A+) [Must end w/ Terminator Block]
  762.  
  763. - ---------------------------------------------------------------
  764.  
  765. HEADER:
  766. =======
  767.      byte #     Description
  768.      ------     ------------------------------------------
  769.      00-12      "Creative Voice File"
  770.      13         1A (eof to abort printing of file)
  771.      14-15      Offset of first datablock in .voc file (std 1A 00
  772.                 in Intel Notation)
  773.      16-17      Version number (minor,major) (VOC-HDR puts 0A 01)
  774.      18-19      2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11)
  775.  
  776. - ---------------------------------------------------------------
  777.  
  778. DATA BLOCK:
  779. ===========
  780.  
  781.    Data Block:  TYPE(1-byte), SIZE(3-bytes), INFO(0+ bytes)
  782.    NOTE: Terminator Block is an exception -- it has only the TYPE byte.
  783.  
  784.       TYPE   Description     Size (3-byte int)   Info
  785.       ----   -----------     -----------------   -----------------------
  786.       00     Terminator      (NONE)              (NONE)
  787.       01     Sound data      2+length of data    *
  788.       02     Sound continue  length of data      Voice Data
  789.       03     Silence         3                   **
  790.       04     Marker          2                   Marker# (2 bytes)
  791.       05     ASCII           length of string    null terminated string
  792.       06     Repeat          2                   Count# (2 bytes)
  793.       07     End repeat      0                   (NONE)
  794.       08     Extended        4                   ***
  795.  
  796.       *Sound Info Format:       **Silence Info Format:
  797.        ---------------------      ----------------------------
  798.        00   Sample Rate           00-01  Length of silence - 1
  799.        01   Compression Type      02     Sample Rate
  800.        02+  Voice Data
  801.  
  802.     ***Extended Info Format:
  803.        ---------------------
  804.        00-01  Time Constant: Mono: 65536 - (256000000/sample_rate)
  805.                              Stereo: 65536 - (25600000/(2*sample_rate))
  806.        02     Pack
  807.        03     Mode: 0 = mono
  808.                     1 = stereo
  809.  
  810.  
  811.   Marker#           -- Driver keeps the most recent marker in a status byte
  812.   Count#            -- Number of repetitions + 1
  813.                          Count# may be 1 to FFFE for 0 - FFFD repetitions
  814.                          or FFFF for endless repetitions
  815.   Sample Rate       -- SR byte = 256-(1000000/sample_rate)
  816.   Length of silence -- in units of sampling cycle
  817.   Compression Type  -- of voice data
  818.                          8-bits    = 0
  819.                          4-bits    = 1
  820.                          2.6-bits  = 2
  821.                          2-bits    = 3
  822.                          Multi DAC = 3+(# of channels) [interesting--
  823.                                        this isn't in the developer's manual]
  824.  
  825. ------------------------------------------------------------------------
  826. RIFF WAVE (.WAV) file format
  827. ----------------------------
  828.  
  829. RIFF is a format by Microsoft and IBM which is similar in spirit and
  830. functionality as EA-IFF-85, but not compatible (and it's in
  831. little-endian byte order, of course :-).  WAVE is RIFF's equivalent of
  832. AIFF, and its inclusion in Microsoft Windows 3.1 has suddenly made it
  833. important to know about.
  834.  
  835. Rob Ryan was kind enough to send me a description of the RIFF format.
  836. Unfortunately, it is too big to include here (27 k), but I've made it
  837. available for anonymous ftp as ftp.cwi.nl:/pub/audio/RIFF-format.
  838.  
  839. And here's a pointer to the official description from Matt Saettler,
  840. Microsoft Multimedia:
  841.  
  842. "The complete definition of the WAVE file format as defined by
  843. IBM/Microsoft is available for anon. FTP from ftp.uu.net in the
  844. vendor/microsoft/multimedia directory."
  845.  
  846. (Rob Ryan's version may actually be an extract from one of the files
  847. stored there.)
  848.  
  849. ------------------------------------------------------------------------
  850. U-LAW and A-LAW definitions
  851. ---------------------------
  852.  
  853. [Adapted from information provided by duggan@cc.gatech.edu (Rick
  854. Duggan) and davep@zenobia.phys.unsw.EDU.AU (David Perry)]
  855.  
  856. u-LAW (really mu-LAW) is
  857.  
  858.           sgn(m)   (     |m |)       |m |
  859.    y=    ------- ln( 1+ u|--|)       |--| =< 1
  860.          ln(1+u)   (     |mp|)       |mp|         
  861.  
  862. A-LAW is
  863.  
  864.      |     A    (m )                 |m |    1
  865.      |  ------- (--)                 |--| =< - 
  866.      |  1+ln A  (mp)                 |mp|    A     
  867.    y=|
  868.      | sgn(m) (        |m |)    1    |m |
  869.      | ------ ( 1+ ln A|--|)    - =< |--| =< 1
  870.      | 1+ln A (        |mp|)    A    |mp|         
  871.  
  872. Values of u=100 and 255, A=87.6, mp is the Peak message value, m is
  873. the current quantised message value.  (The formulae get simpler if you
  874. substitute x for m/mp and sgn(x) for sgn(m); then -1 <= x <= 1.)
  875.  
  876. Converting from u-LAW to A-LAW is in a sense "lossy" since there are
  877. quantizing errors introduced in the conversion.
  878.  
  879. "..the u-LAW used in North America and Japan, and the
  880. A-LAW used in Europe and the rest of the world and
  881. international routes.."
  882.  
  883. References:
  884.  
  885. Modern Digital and Analog Communication Systems, B.P.Lathi., 2nd ed.
  886. ISBN 0-03-027933-X
  887.  
  888. Transmission Systems for Communications
  889. Fifth Edition
  890. by Members of the Technical Staff at Bell Telephone Laboratories
  891. Bell Telephone Laboratories, Incorporated
  892. Copyright 1959, 1964, 1970, 1982
  893.  
  894. A note on the resolution of U-LAW by Frank Klemm <pfk@rz.uni-jena.de>:
  895.  
  896. 8 bit U-LAW has the same lowest  magnitude like 12 bit linear and 12 bit
  897. U-LAW like 16 linear.
  898.  
  899. Device/Coding   Resolution              Resolution
  900.                 on maximal level        on low level
  901.  8 bit linear    8                       8
  902.  8 bit ulaw      6                      12      (used for digital telephone)
  903. 12 bit linear   12                      12
  904. 12 bit ulaw     10                      16      (used in DAT/Longplay)
  905. 16 bit linear   16                      16
  906.  
  907. estimated for some analoge technique:
  908. tape recorder (HiFi DIN)
  909.                  8                       9      (no Problem today)
  910. tape recorder (semiprofessional)
  911.                 10.5                    13.5 
  912.  
  913. ------------------------------------------------------------------------
  914. AVR File Format
  915. ---------------
  916.  
  917. From: hyc@hanauma.Jpl.Nasa.Gov (Howard Chu)
  918.  
  919. A lot of PD software exists to play Mac .snd files on the ST. One other
  920. format that seems pretty popular (used by a number of commercial packages)
  921. is the AVR format (from Audio Visual Research). This format has a 128 byte
  922. header that looks like this:
  923.  
  924.         char magic[4]="2BIT";
  925.         char name[8];           /* null-padded sample name */
  926.         short mono;             /* 0 = mono, 0xffff = stereo */
  927.         short rez;              /* 8 = 8 bit, 16 = 16 bit */
  928.         short sign;             /* 0 = unsigned, 0xffff = signed */
  929.         short loop;             /* 0 = no loop, 0xffff = looping sample */
  930.         short midi;             /* 0xffff = no MIDI note assigned,
  931.                                    0xffXX = single key note assignment
  932.                                    0xLLHH = key split, low/hi note */
  933.         long rate;              /* sample frequency in hertz */
  934.         long size;              /* sample length in bytes or words (see rez) */
  935.         long lbeg;              /* offset to start of loop in bytes or words.
  936.                                    set to zero if unused. */
  937.         long lend;              /* offset to end of loop in bytes or words.
  938.                                    set to sample length if unused. */
  939.         short res1;             /* Reserved, MIDI keyboard split */
  940.         short res2;             /* Reserved, sample compression */
  941.         short res3;             /* Reserved */
  942.         char ext[20];           /* Additional filename space, used
  943.                                    if (name[7] != 0) */
  944.         char user[64];          /* User defined. Typically ASCII message. */
  945.  
  946. -----------------------------------------------------------------------
  947. The Amiga MOD Format
  948. --------------------
  949.  
  950. From: norlin@mailhost.ecn.uoknor.edu (Norman Lin)
  951.  
  952. MOD files are music files containing 2 parts:
  953.  
  954. (1) a bank of digitized samples
  955. (2) sequencing information describing how and when to play the samples
  956.  
  957. MOD files originated on the Amiga, but because of their flexibility
  958. and the extremely large number of MOD files available, MOD players
  959. are now available for a variety of machines (IBM PC, Mac, Sparc
  960. Station, etc.)
  961.  
  962. The samples in a MOD file are raw, 8 bit, signed, headerless, linear
  963. digital data.  There may be up to 31 distinct samples in a MOD file,
  964. each with a length of up to 128K (though most are much smaller; say,
  965. 10K - 60K).  An older MOD format only allowed for up to 15 samples in
  966. a MOD file; you don't see many of these anymore.  There is no standard
  967. sampling rate for these samples.  [But see below.]
  968.  
  969. The sequencing information in a MOD file contains 4 tracks of
  970. information describing which, when, for how long, and at what frequency
  971. samples should be played.  This means that a MOD file can have up
  972. to 31 distinct (digitized) instrument sounds, with up to 4 playing
  973. simultaneously at any given point.  This allows a wide variety
  974. of orchestrational possibilities, including use of voice samples
  975. or creation of one's own instruments (with appropriate sampling
  976. hardware/software).  The ability to use one's own samples as instruments
  977. is a flexibility that other music files/formats do not share, and
  978. is one of the reasons MOD files are so popular, numerous, and diverse.
  979.  
  980. 15 instrument MODs, as noted above, are somewhat older than 31
  981. instrument MODs and are not (at least not by me) seen very often
  982. anymore.  Their format is identical to that of 31 instrument MODs
  983. except:
  984.  
  985. (1) Since there are only 15 samples, the information for the last (15th)
  986.     sample starts at byte 440 and goes through byte 469.
  987. (2) The songlength is at byte 470 (contrast with byte 950 in 31 instrument
  988.     MOD)
  989. (3) Byte 471 appears to be ignored, but has been observed to be 127.
  990.     (Sorry, this is from observation only)
  991. (4) Byte 472 begins the pattern sequence table (contrast with byte 952
  992.     in a 31 instrument MOD)
  993. (5) Patterns start at byte 600 (contrast with byte 1084 in 31 instrument MOD)
  994.  
  995. "ProTracker," an Amiga MOD file creator/editor, is available for ftp
  996. everywhere as pt??.lzh.
  997.  
  998. From: Apollo Wong <apollo@ee.ualberta.ca>
  999.  
  1000. From: M.J.H.Cox@bradford.ac.uk (Mark Cox)
  1001. Newsgroups: alt.sb.programmer
  1002. Subject: Re: Format for MOD files...
  1003. Message-ID: <1992Mar18.103608.4061@bradford.ac.uk>
  1004. Date: 18 Mar 92 10:36:08 GMT
  1005. Organization: University of Bradford, UK
  1006.  
  1007. wdc50@DUTS.ccc.amdahl.com (Winthrop D Chan) writes:
  1008. >I'd like to know if anyone has a reference document on the format of the
  1009. >Amiga Sound/NoiseTracker (MOD) files. The author of Modplay said he was going
  1010. >to release such a document sometime last year, but he never did. If anyone
  1011.  
  1012. I found this one, which covers it better than I can explain it - if you
  1013. use this in conjunction with the documentation that comes with Norman
  1014. Lin's Modedit program it should pretty much cover it.
  1015.  
  1016. Mark J Cox
  1017.  
  1018. /***********************************************************************
  1019.  
  1020. Protracker 1.1B Song/Module Format:
  1021. -----------------------------------
  1022.  
  1023. Offset  Bytes  Description
  1024. ------  -----  -----------
  1025.    0     20    Songname. Remember to put trailing null bytes at the end...
  1026.  
  1027. Information for sample 1-31:
  1028.  
  1029. Offset  Bytes  Description
  1030. ------  -----  -----------
  1031.   20     22    Samplename for sample 1. Pad with null bytes.
  1032.   42      2    Samplelength for sample 1. Stored as number of words.
  1033.                Multiply by two to get real sample length in bytes.
  1034.   44      1    Lower four bits are the finetune value, stored as a signed
  1035.                four bit number. The upper four bits are not used, and
  1036.                should be set to zero.
  1037.                Value:  Finetune:
  1038.                  0        0
  1039.                  1       +1
  1040.                  2       +2
  1041.                  3       +3
  1042.                  4       +4
  1043.                  5       +5
  1044.                  6       +6
  1045.                  7       +7
  1046.                  8       -8
  1047.                  9       -7
  1048.                  A       -6
  1049.                  B       -5
  1050.                  C       -4
  1051.                  D       -3
  1052.                  E       -2
  1053.                  F       -1
  1054.  
  1055.   45      1    Volume for sample 1. Range is $00-$40, or 0-64 decimal.
  1056.   46      2    Repeat point for sample 1. Stored as number of words offset
  1057.                from start of sample. Multiply by two to get offset in bytes.
  1058.   48      2    Repeat Length for sample 1. Stored as number of words in
  1059.                loop. Multiply by two to get replen in bytes.
  1060.  
  1061. Information for the next 30 samples starts here. It's just like the info for
  1062. sample 1.
  1063.  
  1064. Offset  Bytes  Description
  1065. ------  -----  -----------
  1066.   50     30    Sample 2...
  1067.   80     30    Sample 3...
  1068.    .
  1069.    .
  1070.    .
  1071.  890     30    Sample 30...
  1072.  920     30    Sample 31...
  1073.  
  1074. Offset  Bytes  Description
  1075. ------  -----  -----------
  1076.  950      1    Songlength. Range is 1-128.
  1077.  951      1    Well... this little byte here is set to 127, so that old
  1078.                trackers will search through all patterns when loading.
  1079.                Noisetracker uses this byte for restart, but we don't.
  1080.  952    128    Song positions 0-127. Each hold a number from 0-63 that
  1081.                tells the tracker what pattern to play at that position.
  1082. 1080      4    The four letters "M.K." - This is something Mahoney & Kaktus
  1083.                inserted when they increased the number of samples from
  1084.                15 to 31. If it's not there, the module/song uses 15 samples
  1085.                or the text has been removed to make the module harder to
  1086.                rip. Startrekker puts "FLT4" or "FLT8" there instead.
  1087.  
  1088. Offset  Bytes  Description
  1089. ------  -----  -----------
  1090. 1084    1024   Data for pattern 00.
  1091.    .
  1092.    .
  1093.    .
  1094. xxxx  Number of patterns stored is equal to the highest patternnumber
  1095.       in the song position table (at offset 952-1079).
  1096.  
  1097. Each note is stored as 4 bytes, and all four notes at each position in
  1098. the pattern are stored after each other.
  1099.  
  1100. 00 -  chan1  chan2  chan3  chan4
  1101. 01 -  chan1  chan2  chan3  chan4
  1102. 02 -  chan1  chan2  chan3  chan4
  1103. etc.
  1104.  
  1105. Info for each note:
  1106.  
  1107.  _____byte 1_____   byte2_    _____byte 3_____   byte4_
  1108. /                \ /      \  /                \ /      \
  1109. 0000          0000-00000000  0000          0000-00000000
  1110.  
  1111. Upper four    12 bits for    Lower four    Effect command.
  1112. bits of sam-  note period.   bits of sam-
  1113. ple number.                  ple number.
  1114.  
  1115. Periodtable for Tuning 0, Normal
  1116.   C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453
  1117.   C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226
  1118.   C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113
  1119.  
  1120. To determine what note to show, scan through the table until you find
  1121. the same period as the one stored in byte 1-2. Use the index to look
  1122. up in a notenames table.
  1123.  
  1124. This is the data stored in a normal song. A packed song starts with the
  1125. four letters "PACK", but i don't know how the song is packed: You can
  1126. get the source code for the cruncher/decruncher from us if you need it,
  1127. but I don't understand it; I've just ripped it from another tracker...
  1128.  
  1129. In a module, all the samples are stored right after the patterndata.
  1130. To determine where a sample starts and stops, you use the sampleinfo
  1131. structures in the beginning of the file (from offset 20). Take a look
  1132. at the mt_init routine in the playroutine, and you'll see just how it
  1133. is done.
  1134.  
  1135. Lars "ZAP" Hamre/Amiga Freelancers
  1136.  
  1137. ***********************************************************************/
  1138.  
  1139. -- 
  1140. Mark J Cox -----
  1141. Bradford, UK ---
  1142.  
  1143.  
  1144. PS: A file with even *much* more info on MOD files, compiled by Lars
  1145. Hamre, is available from ftp.cwi.nl:/pub/audio/MOD-info.  Enjoy!
  1146.  
  1147.  
  1148. FTP sites for MODs and MOD players
  1149. ----------------------------------
  1150.  
  1151. Subject: MODS AND PLAYERS!! **READ** info/where to get them
  1152. From: cjohnson@tartarus.uwa.edu.au (Christopher Johnson)
  1153. Newsgroups: alt.binaries.sounds.d
  1154. Message-ID: <1h32ivINNglu@uniwa.uwa.edu.au>
  1155. Date: 21 Dec 92 00:19:43 GMT
  1156. Organization: The University of Western Australia
  1157.  
  1158. Hello world,
  1159.  
  1160. For all those asking, here is where to get those mod players and mods.
  1161.  
  1162. SNAKE.MCS.KENT.EDU is the best site for general stuff.  look in /pub/SB-Adlib
  1163.  
  1164. Simtel-20 or archie.au(simtel mirror) in <msdos.sound>
  1165.  
  1166. for windows players ftp.cica.indiana.edu in pub/pc/win3/sound
  1167.  
  1168. here is a short list of players
  1169.  
  1170. mp or modplay   BEST OVERALL                    mp219b.zip      
  1171.         simtel and snake
  1172.  
  1173. wowii           best for vga/fast machines      wowii12b.zip    
  1174.         simtel and snake
  1175.  
  1176. trakblaster     best for compatability          trak-something  
  1177.         simtel and snake        two versions, old one for slow
  1178.         machines
  1179.  
  1180. ss              cute display(hifi)              have_sex.arj
  1181.         found on local BBS (western Australia White Ghost)
  1182.  
  1183. superpro player generally good                  ssp.zip or similar
  1184.         found on night owl 7 CD
  1185.  
  1186. player?         cute display(hifi)              player.zip or similar
  1187.         found on night owl 7 CD
  1188.  
  1189. WINDOWS
  1190.  
  1191. Winmod pro      does protracker                 wmp????.zip
  1192.         cica
  1193.  
  1194. winmod          more stable                     winmod12.zip or similar
  1195.         cica
  1196.  
  1197. Hope this helps, e-mail me if you find any more players and I will add them in for the next time mod player requests get a
  1198. little out of hand.
  1199.  
  1200. for mods ftp to wuarchive.wustl.edu and go to the amiga music directory (pub/amiga/music/ntsb ?????)  that should do you for
  1201. a while
  1202.  
  1203. see you soon
  1204.  
  1205. Chris.
  1206.  
  1207. -----------------------------------------------------------------------
  1208.